package com.hiof.moraa.server.service.model;

import java.util.Date;

/**
 *
 * @author Bergy
 */
public class LiveMediaFeed extends Feed {

    private String attendantCode;
    private String relativeFilePath;
    private double lat;
    private double lng;
    private double height;
    private TypeOfAttendant typeOfAttendant;

    public LiveMediaFeed(int userId, String username, String fullname, String profilePicture, Date timestamp, String attendantCode, String relativeFilePath, double lat, double lng, double height, TypeOfAttendant typeOfAttendant) {
        super(userId, username, fullname, profilePicture, timestamp);
        this.attendantCode = attendantCode;
        this.relativeFilePath = relativeFilePath;
        this.lat = lat;
        this.lng = lng;
        this.height = height;
        this.typeOfAttendant = typeOfAttendant;
    }

    public double getHeight() {
        return height;
    }

    public double getLat() {
        return lat;
    }

    public double getLng() {
        return lng;
    }

    public String getRelativeFilePath() {
        return relativeFilePath;
    }

    public String getThumbnailPath() {
        int mid = relativeFilePath.lastIndexOf(".");
        String fname = relativeFilePath.substring(0, mid);
        String ext = relativeFilePath.substring(mid + 1, relativeFilePath.length());
        return fname + "_thumb." + ext;
    }

    public String getIconPath() {
        int mid = relativeFilePath.lastIndexOf(".");
        String fname = relativeFilePath.substring(0, mid);
        String ext = relativeFilePath.substring(mid + 1, relativeFilePath.length());
        return fname + "_icon." + ext;
    }

    public String getAttendantCode() {
        return attendantCode;
    }

    public TypeOfAttendant getTypeOfAttendant() {
        return typeOfAttendant;
    }

    public void setTypeOfAttendant(TypeOfAttendant typeOfAttendant) {
        this.typeOfAttendant = typeOfAttendant;
    }

    @Override
    public String getDescription() {
        return " took the picture. ";
    }

    @Override
    public String getType() {
        return "LiveMediaFeed";
    }
}
